package com.bytenerd.common.base;

import com.bytenerd.common.enums.ResponseCode;

import java.io.Serializable;

/**
 * @auther bytenerd
 * @param <T>
 */
public class BaseResponse<T> implements Serializable {
    private final Integer code;

    private final T data;

    private final String msg;

    public BaseResponse(int code,T data,String msg){
        this.code = code;
        this.data = data;
        this.msg = msg;
    }

    public BaseResponse(int code,T data){
        this(code,data,"");
    }

    public BaseResponse(ResponseCode responseCode){
        this(responseCode.getCode(),null,responseCode.getMsg());
    }

    public BaseResponse(ResponseCode responseCode,String msg){
        this(responseCode.getCode(),null,msg);
    }
}
